package org.br.erp.base.service.impl;

import java.util.List;

import org.br.erp.base.entity.Scmcustomformatlink;
import org.br.erp.base.mapper.ScmcustomformatlinkMapper;
import org.br.erp.base.service.IScmcustomformatlinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 自定义格式分配
 * @Author: jeecg-boot
 * @Date: 2023-11-10
 * @Version: V1.0
 */
@Service
public class ScmcustomformatlinkServiceImpl extends ServiceImpl<ScmcustomformatlinkMapper, Scmcustomformatlink>
        implements IScmcustomformatlinkService {

    @Autowired
    ScmcustomformatlinkMapper scmcustomformatlinkMapper;

    @Override
    public List<Scmcustomformatlink> getCustomFormatLinkByFormatId(String formatid) {
        QueryWrapper<Scmcustomformatlink> queryWrapper = new QueryWrapper();
        queryWrapper.eq("customformatid", formatid);
        List<Scmcustomformatlink> scmcustomformatlinks = scmcustomformatlinkMapper.selectList(queryWrapper);
        return scmcustomformatlinks;
        // throw new UnsupportedOperationException("Unimplemented method
        // 'getCustomFormatLinkByFormatId'");
    }

    @Override
    public List<Scmcustomformatlink> getCustomFormatLinkByObjectCodeAndUserid(String obejctcode, String userid) {

        QueryWrapper<Scmcustomformatlink> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("linkmanid", userid);
        queryWrapper.eq("objectcode", obejctcode);

        List<Scmcustomformatlink> selectList = scmcustomformatlinkMapper.selectList(queryWrapper);
        return selectList;
    }

}
